Run Scenario Script
Contents
Run Gazebo simulation of Care-O-bot
Make sure you start the Care-O-bot Gazebo simulation first. See this tutorial.
roslaunch cob_experimentation_days experimentation_days_sim.launch
NOTE: Gazebo has high hardware requirements. Normally you see no real time. If you have problems to run gazebo you can look to Gazebo troubleshooting. You can change the view in the simulator.
Add a milk box to the simulation environment
roslaunch cob_gazebo_worlds milk_box.launch
Run Scenario
The Care-O-bot task programming is implemented as a state machine using smach. As you can see in the picture below there are different states, e.g. "wait for task", "move to location" or "grasp object". These smach state machine is written in python script. To run the script execute
rosrun cob_experimentation_days experimentation_days.py
Now you can follow the human readable commands on the terminal and see how the robot starts moving towards the kitchen, grasps the object and delivers it to the sofa.
Smach Viewer
Smach viewer shows a graphical represeantation of the sate machine which is running in order to let the robot perform a task. To visualize the current script run
rosrun smach_viewer smach_viewer.py
The task grogramming of Care-O-bot is done in smach. You can do some Smach Tutorials to learn more about Smach.
Have a look at the source code of the scenario script
In preparation to your homework, have a look at the source code of the script for a better understanding of the state machine and how the robot is programmed. You can find the overall state machine which shows the connection between the individual states in
roscd cob_experimentation_days gedit scripts/experimentation_days.py
Most of the states are called generic states because they can be reused in a different context. Have a look at them in
roscd cob_generic_states gedit src/generic_navigation_states.py src/generic_manipulation_states.py src/generic_perception_states.py
If the script is running on your pc: Congratulation! Now you can do your first homework.